fix-fc-dual-font-width-calculation.diff
authorRob Browning <rlb@defaultvalue.org>
Tue, 5 Apr 2011 03:46:37 +0000 (22:46 -0500)
committerRob Browning <rlb@defaultvalue.org>
Tue, 5 Apr 2011 03:46:37 +0000 (22:46 -0500)
* The font width should now be computed correctly for dual-width fonts.
  Patch: fix-fc-dual-font-width-calculation.diff
Provided-by: Sven Joachim <svenjoac@gmx.de>
  Date: Mon, 12 Jul 2010 16:32:53 +0200
Added-by: Rob Browning <rlb@defaultvalue.org>
  Status: incorporated upstream

  The Debian patch is taken from this upstream commit:

  revno: 99907
  author: Naohiro Aota  <naota@elisp.net>
  committer: Chong Yidong <cyd@stupidchicken.com>
  branch nick: emacs-23
  timestamp: Wed 2010-06-30 10:22:18 -0400
  message:
    Check FC_DUAL too.  For such fonts, check width one by one (Bug#4129).
    * xftfont.c (xftfont_open): Check font width one by one also when
    spacing is dual.

    * ftfont.c (ftfont_open): Ditto.

src/ChangeLog
src/ftfont.c
src/xftfont.c

index f5c73db18e07200008978de76181b11f73cd08ba..59eaf4867382487b64ddfb136a2581a200376a95 100644 (file)
@@ -8,6 +8,13 @@
        * eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA
        (Bug#6214).
 
+2010-06-30  Naohiro Aota  <naota@elisp.net>  (tiny change)
+
+       * xftfont.c (xftfont_open): Check font width one by one also when
+       spacing is dual.
+
+       * ftfont.c (ftfont_open): Ditto.
+
 2010-05-18  Chong Yidong  <cyd@stupidchicken.com>
 
        * character.c (Fstring, Funibyte_string): Use SAFE_ALLOCA to
index 6956c134a7c9880a9225306bee429cb83bdcbc31..7801f22e26eb13ea293a0566217ad9e9fd1595f3 100644 (file)
@@ -1262,7 +1262,7 @@ ftfont_open (f, entity, pixel_size)
     spacing = XINT (AREF (entity, FONT_SPACING_INDEX));
   else
     spacing = FC_PROPORTIONAL;
-  if (spacing != FC_PROPORTIONAL)
+  if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL)
     font->min_width = font->average_width = font->space_width
       = (scalable ? ft_face->max_advance_width * size / upEM
         : ft_face->size->metrics.max_advance >> 6);
index 5d4581be4e94b37ae6f74762186fcc92a724a611..197cc9c1f5b6e0a22ac2eb7f1b12d39e83f63b8a 100644 (file)
@@ -429,7 +429,7 @@ xftfont_open (f, entity, pixel_size)
        ascii_printable[i] = ' ' + i;
     }
   BLOCK_INPUT;
-  if (spacing != FC_PROPORTIONAL)
+  if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL)
     {
       font->min_width = font->average_width = font->space_width
        = xftfont->max_advance_width;